﻿#ifndef DIALOG_H
#define DIALOG_H

#include <QDialog>
#include <QTimer>
#include <QElapsedTimer>
QT_BEGIN_NAMESPACE
namespace Ui { class Dialog; }
QT_END_NAMESPACE

class Dialog : public QDialog
{
    Q_OBJECT

public:
    Dialog(QWidget *parent = nullptr);
    ~Dialog();
private:
    void init();
    void initTimer();
    void lcd_display(bool isInit = false);
private slots:
    void do_valueChanged(int data);
    void on_sb_x_control_valueChanged(int value);
    void on_cb_textVisable_clicked(bool checked);
    void on_cb_inverted_clicked(bool checked);
    void on_rb_percentage_clicked();
    void on_rb_number_clicked();

    void on_pbn_start_clicked();

    void on_pbn_stop_clicked();
    void do_timer_timeout();
    void on_pbn_getcurtime_clicked();

    void on_dde_datetime_dateTimeChanged(const QDateTime &dateTime);

private:
    Ui::Dialog *ui;
    QTimer *m_timer;
    QElapsedTimer m_counter; //计算耗时
    int m_cycle_count;
};
#endif // DIALOG_H
